﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using MasterDetailTemplate.Util;
using Xamarin.Forms;

namespace MasterDetailTemplate.Converters {
    /// <summary>
    /// ItemTrapperEventArgs到菜单项转换器
    /// </summary>
    public class ItemTappedEventArgsToMenuItemConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter,
            CultureInfo culture) =>
            (value as ItemTappedEventArgs)?.Item as Models.MenuItem;

        public object ConvertBack(object value, Type targetType,
            object parameter, CultureInfo culture) {
            throw new DoNotCallThisExcpetion();
        }
    }
}